<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
      layout:decorate="~{fragments/main_layout}">
<head>
    <meta charset="UTF-8">
    <title>注册表单</title>
</head>
<body>
<div layout:fragment="content" class="container">
    <form th:action="@{/addTask}" th:object="${task}" method="post">
        <div class="form-group">
            <label for="date" class="form-control-label">日期</label>
            <input type="date" class="form-control" th:field="*{date}" id="date">
            <div class="text text-danger" th:if="${#fields.hasErrors('date')}" th:errors="*{date}"></div>
        </div>
        <div class="form-group">
            <label for="startTime" class="form-control-label">开始时间</label>
            <input type="time" class="form-control" th:field="*{startTime}" id="startTime">
            <div class="text text-danger" th:if="${#fields.hasErrors('startTime')}" th:errors="*{startTime}"></div>
        </div>
        <div class="form-group">
            <label for="stopTime" class="form-control-label">结束时间</label>
            <input type="time" class="form-control" th:field="*{stopTime}" id="stopTime">
            <div class="text text-danger" th:if="${#fields.hasErrors('stopTime')}" th:errors="*{stopTime}"></div>
        </div>
        <div class="form-group">
            <label for="description" class="form-control-label">描述</label>
            <textarea class="form-control" th:field="*{description}" id="description"></textarea>
            <div class="text text-danger" th:if="${#fields.hasErrors('description')}" th:errors="*{description}"></div>
        </div>
        <input type="submit" value="提交" class="btn btn-primary">
    </form>
</div>
</body>
</html>